#pragma once
#include "Metodos.h"

namespace prueba {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	/// <summary>
	/// Summary for Form1
	/// </summary>
	public ref class Form1 : public System::Windows::Forms::Form
	{
	public:
		Form1(void)
		{
			InitializeComponent();
			//
			//TODO: Add the constructor code here
			//
		}
	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~Form1()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::Label^  lblMsg;
	protected: 
	private: System::Windows::Forms::Button^  btnMsg;
	private: System::Windows::Forms::TextBox^  txtMsg1;

	private: System::Windows::Forms::TextBox^  txtMsg2;


	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
		System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		
		void InitializeComponent(void)
		{
			this->lblMsg = (gcnew System::Windows::Forms::Label());
			this->btnMsg = (gcnew System::Windows::Forms::Button());
			this->txtMsg1 = (gcnew System::Windows::Forms::TextBox());
			this->txtMsg2 = (gcnew System::Windows::Forms::TextBox());
			this->SuspendLayout();
			// 
			// lblMsg
			// 
			this->lblMsg->AutoSize = true;
			this->lblMsg->Location = System::Drawing::Point(25, 200);
			this->lblMsg->Name = L"lblMsg";
			this->lblMsg->Size = System::Drawing::Size(0, 13);
			this->lblMsg->TabIndex = 0;
			// 
			// btnMsg
			// 
			this->btnMsg->Location = System::Drawing::Point(177, 113);
			this->btnMsg->Name = L"btnMsg";
			this->btnMsg->Size = System::Drawing::Size(75, 23);
			this->btnMsg->TabIndex = 1;
			this->btnMsg->Text = L"ClickMe";
			this->btnMsg->UseVisualStyleBackColor = true;
			this->btnMsg->Click += gcnew System::EventHandler(this, &Form1::btnMsg_Click);
			// 
			// txtMsg1
			// 
			this->txtMsg1->Location = System::Drawing::Point(28, 26);
			this->txtMsg1->Name = L"txtMsg1";
			this->txtMsg1->Size = System::Drawing::Size(100, 20);
			this->txtMsg1->TabIndex = 2;
			// 
			// txtMsg2
			// 
			this->txtMsg2->Location = System::Drawing::Point(28, 62);
			this->txtMsg2->Name = L"txtMsg2";
			this->txtMsg2->Size = System::Drawing::Size(100, 20);
			this->txtMsg2->TabIndex = 3;
			// 
			// Form1
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(284, 262);
			this->Controls->Add(this->txtMsg2);
			this->Controls->Add(this->txtMsg1);
			this->Controls->Add(this->btnMsg);
			this->Controls->Add(this->lblMsg);
			this->Name = L"Form1";
			this->Text = L"Form1";
			this->ResumeLayout(false);
			this->PerformLayout();

		}
		
#pragma endregion
	
	private: System::Void btnMsg_Click(System::Object^  sender, System::EventArgs^  e) {
				 int a;
				 int b;
				 Metodos met;

				 a =  Convert::ToInt32(txtMsg1->Text);
				 b =  Convert::ToInt32(txtMsg2->Text);

				 String ^ c = System::Convert::ToString(met.suma(a,b));
				 lblMsg->Text = c;
				 
			 }
	};
	
}